package com.kuang.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


//等价于<bean id="user" class="com.kuang.pojo.User"/>
//作用域 单例singleton   原型prototype
@Component
@Scope("singleton")
public class User {
    //public String name="黄佳林";

    public String name;
    @Value("黄佳林")
    public void setName(String name) {
        this.name = name;
    }
}
